import request from '@/config/axios'

export interface GoodsCategoryVO {
  id: number
  status: byte
  sort: number
  updateTime: Date
  creator: string
  updater: string
  pic: string
  name: string
}

// 查询产品分类管理列表
export const getGoodsCategoryPage = async (params) => {
  return await request.get({ url: `/cms/goods-category/page`, params })
}

// 查询产品分类管理详情
export const getGoodsCategory = async (id: number) => {
  return await request.get({ url: `/cms/goods-category/get?id=` + id })
}

// 新增产品分类管理
export const createGoodsCategory = async (data: GoodsCategoryVO) => {
  return await request.post({ url: `/cms/goods-category/create`, data })
}

// 修改产品分类管理
export const updateGoodsCategory = async (data: GoodsCategoryVO) => {
  return await request.put({ url: `/cms/goods-category/update`, data })
}

// 删除产品分类管理
export const deleteGoodsCategory = async (id: number) => {
  return await request.delete({ url: `/cms/goods-category/delete?id=` + id })
}

// 导出产品分类管理 Excel
export const exportGoodsCategory = async (params) => {
  return await request.download({ url: `/cms/goods-category/export-excel`, params })
}
